home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ MSO2K OTL Security 1.xpl < prev    next >
Text File  |  2004-04-06  |  4KB  |  152 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="8"
  3. "COUNT"="2"
  4. "UIPATH"="Program Options\Microsoft Office\MS Office 2000\Outlook 2000"
  5. "NAME"="Email Files Security"
  6. "VERSION"="1.05"
  7. "LANGUAGE"="VBScript"
  8. "TEXT 1"="Add..."
  9. "TEXT 2"="Remove selection"
  10. "DESCRIPTION 1"="Beginning with Outlook 2000 SR1, Outlooks uses a very strict file type security management. This means, you can not access some files from an email at all (so called "Level 1" files, sometimes also called "blocked files") and some can only be saved to disk but not started ("Level 2" files)."
  11. "DESCRIPTION 2"="For example, EXE files are by default Level 1 files which means you can not start them or save them. Outlook simple blocks them and there is no chance to access them."
  12. "DESCRIPTION 3"="With this setting, you can "Downgrade" some of those Level 1 files (no access to all) to Level 2 files (you can save them to disk)."
  13. "DESCRIPTION 4"="Simply click "Add" and enter the extension you do not have access to (e.g. "EXE") so you can save them to disk from a email."
  14. "AUTHOR"="Xteq Systems"
  15. "CONTACTURL"="http://www.xteq.com/"
  16. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  17. "COMMENT 1"="See also MS KB Article ID: Q259228"
  18. "COMMENT 2"="Thanks to mbents for the bug notice"
  19.  
  20.  
  21. sPCheck="HKLM\Software\Microsoft\Office\9.0\"
  22.      sV="HKCU\Software\Microsoft\Office\9.0\Outlook\Security\RemoveWarningFileTypes"
  23.     sV2="HKCU\Software\Microsoft\Office\9.0\Outlook\Security\AddWarningFileTypes"
  24.     sV3="HKCU\Software\Microsoft\Office\9.0\Outlook\Security\Level1Remove"
  25.  
  26.  
  27. iCount=0
  28.  
  29. Sub Plugin_Initialize 
  30. if RegPathExists(sPCheck) then
  31.    Call InitListbox
  32. else
  33.    Call Disable()
  34. end if
  35. End Sub
  36.  
  37.  
  38.  
  39.  
  40. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  41.  if ElementIndex=1 then 'ADD
  42.     s=InputWindow("Please enter the extension to unblock, e.g. <EXE>","",1)
  43.     if IsEmpty(s)=false then
  44.        if Len(s)>0 then
  45.           iCount=iCount+1
  46.           Call SetUIElement(iCount,s)
  47.           Call WriteRegistry()
  48.           Call InitListbox()              
  49.        end if
  50.     end if
  51.  
  52.  elseif ElementIndex=2 then 'REMOVE
  53.    if ElementSubIndex=0 then
  54.       Call MsgError("Please select an extension to remove")
  55.    else
  56.       Call SetUIElement(ElementSubIndex,"")
  57.       iCount=iCount-1
  58.  
  59.       Call WriteRegistry()
  60.       Call InitListbox()
  61.    end if
  62.  end if
  63.  
  64.  
  65. ' Call Logoff()
  66. End Sub
  67.  
  68.  
  69. Sub InitListbox
  70.  for i=1 to iCount
  71.      Call SetUIElement(i,"")
  72.  next
  73.  
  74.  iCount=0
  75.  
  76.  s=RegReadValue(sV)
  77.  if IsEmpty(s)=false then
  78.     'Dim ary()
  79.     ary=Split(s,";")
  80.  
  81.     for l=lBound(ary) to ubound(ary)
  82.         s=ary(l)
  83.         s=lcase(s)
  84.         if len(s)>0 then
  85.            sDesc=GetFileDescription("." & s)
  86.  
  87.            iCount=iCount+1
  88.            Call SetUIElement(iCount,s & " (" & sDesc & ")")
  89.         end if
  90.     next
  91.  end if
  92.  
  93. end sub
  94.  
  95.  
  96. Sub WriteRegistry
  97.  s=""
  98.  for i=1 to iCount
  99.      s2=GetUIElement(i)
  100.      iPos=InStr(s2," ")
  101.      if iPos>0 then
  102.         s2=Left(s2,iPos-1)
  103.         s2=LCase(s2)
  104.      end if
  105.  
  106.      if len(s2)>0 then
  107.         s=s & UCASE(s2) & ";"
  108.      end if
  109.  next
  110.  
  111.  Call RegWriteValue(sV,s,1)
  112.  Call RegWriteValue(sV3,s,1)
  113.  
  114.  'Outlook 2000 needs both entires to work properly!
  115.  if RegValueExists(sV2)=false then
  116.     Call RegWriteValue(sV2,"",1)
  117.  end if
  118. End Sub
  119.  
  120.  
  121. Sub Plugin_Terminate 
  122. End Sub
  123.  
  124.  
  125.  
  126.  
  127. 'VERSION 1.1
  128. 'returns the readable description for a file TYPE. Input is the
  129. 'raw file type (e.g. ".TXT"). 
  130. Function GetFileDescription(DotType)
  131.   sxd_BasePath="HKLM\Software\Classes\"
  132.  
  133.   sxd_Path=sxd_BasePath & DotType & "\@"
  134.   sxd_Val=RegReadValue(sxd_Path)
  135.  
  136.   if IsEmpty(sxd_Val)=true then
  137.      'extended description not found! return default
  138.      GetFileDescription="<UNKNOWN>"
  139.   else
  140.      'found, now get the "real" description
  141.      sxd_Path=sxd_BasePath & sxd_Val & "\@"
  142.      sxd_Name=RegReadValue(sxd_Path)
  143.      
  144.      if IsEmpty(sxd_Name)=true then
  145.         'argh! 
  146.         GetFileDescription="<UNKNOWN>"
  147.      else
  148.         GetFileDescription=sxd_Name
  149.      end if
  150.   end if
  151.  
  152. End Function